package com.system.common.utils;

import org.springframework.beans.BeanUtils;

public class EntityConverterUtil{
    public static <T> T convertToEntity(Object vo, Class<T> entityClass) {
        T entity = null;
        try {
            entity = entityClass.newInstance();
            BeanUtils.copyProperties(vo,entity);
        } catch (Exception e) {
            e.printStackTrace();
        }
        return entity;
    }
}
